package org.tinyweb.core;

import javax.servlet.ServletContext;

/**
 * Created by beyond on 2014/10/24.
 */
public class Path {

    private static final Path path = new Path();
    private String webAppRealPath;

    private Path(){

    }

    void init(ServletContext servletContext){
        webAppRealPath = servletContext.getRealPath("/");
    }

    public static Path instance(){
        return path;
    }

    /**
     * 获取web工程的真实路径
     * @return
     */
    public String getWebAppRealPath() {
        return webAppRealPath;
    }
}
